Skip to content

v0.10.1: entry identity in conda, CLI gaps, H&E tissue v2, owner follow-ups - #623

Draft
guijacquemet wants to merge 32 commits into
mainfrom
integration/v0.10.1
Draft

guijacquemet wants to merge 32 commits into
mainfrom
integration/v0.10.1

Conversation

@guijacquemet

Copy link
Copy Markdown
Contributor

Summary

v0.10.1 integration branch: three reviewed pull requests plus the owner's follow-ups of 4 December 2026. Draft: not to be merged or tagged without the owner's approval.

Folded-in pull requests

Owner follow-ups (4 December 2026), one commit each, by module

  1. describe --id FOLDER=ID (describe_ids.py, describe_questions.py, cli_describe.py, fast_answers.py): names the ID of any condition, biological-repeat or technical-repeat folder in fast mode (repeatable). The ID is checked with the notebook's own rules (Draft.confirm_id). A refusal names the option to give again (--id control=<ID>). The open-question line names only the options that can answer it, so it never offers --accept-ids for a folder with no proposed ID. A label used at two levels takes condition:, repeat: or technical:.
  2. tissue-mask creates a masks folder (tissue_masks_folder.py, cli_tissue_mask.py, run_inputs_tissue.py) when the run has none: <experiment>_masks, or the empty folder --masks names. It records the folder by running preprocessing again with it, as run --masks does, and says so in one line. Its messages are fixed too: the image is named once in a refusal; the next steps give the declare-masks / run / masks commands (no source_channels); the region is named as region_mask = "<ID>", not MaskRequest.
  3. declare-masks --ignore TYPE (ignored_masks.py, mask_declare.py, cli_declare_masks.py, masks/files.py, run/preflight.py, run/outputs.py, manifest.py, run_inputs.py, unrecorded.py): writes ignored_masks.toml beside morphobricks.toml, read strictly. check and run skip the listed types. The manifest records the list and the file's SHA-256 (optional key ignored_masks), so RunInputs.open neither refuses those files as unrecorded nor accepts a list changed since the run (RUN_FOLDER_STALE). The R_MASK_TYPE_NOT_DECLARED fix names --ignore beside --type.
  4. A_DESCRIPTION_REQUIRED (required_description.py) names both routes that publish a description: the notebook and describe ... --publish.
  5. docs/plan.md question 94: v0.10.1: command-line gaps before the next brick (describe, check, declare-masks, convert) #620's CLI choices are reworded as proposed by the session that built v0.10.1: command-line gaps before the next brick (describe, check, declare-masks, convert) #620 (3 December 2026), pending the owner's review.

Docs: user guide §5 (describe --id, declare-masks --ignore, tissue-mask, the whole H&E route on the command line), §6, §8; contract §9 (the manifest's ignored_masks key); plan §12 Q94; CHANGELOG Unreleased (v0.10.1); AGENTS.md repository map.

Decisions

  • Items 1–5: the owner, 4 December 2026 (recorded in plan §12 Q94).
  • Where the ignore list lives: asked the same day, since the description schema is closed by the Spec. Owner's choice: a TOML file in the output folder, recorded in the manifest.
  • Session choices, open to review:
    • the default masks folder <experiment>_masks beside the experiment;
    • recording it by re-running preprocessing with masks_folder= (the manifest is never edited in place);
    • an existing folder that is not empty is refused;
    • --id is refused for a published description or --strict (as --rgb-header-override is);
    • declaring a type takes it off the ignore list;
    • names in the ignore list are compared exactly, as declared types are.

Notes for review

  • Format: the manifest version is unchanged. ignored_masks is an optional key, and ignored_masks.toml an optional file. A v0.10.0 reader ignores the key, so it refuses the skipped labels as unrecorded: refused, never read wrongly.
  • --ignore limitation: for a masks-folder type (not OME-Zarr labels), folder-layout warnings about that type's files (mask_without_image, for example) are computed before the skip and can still appear.
  • Follow-up, not done: the owner asked for a review of how many files the output folder holds, and a consolidation if it is getting out of hand.
  • Not verified:
    • the notebook card's new tissue-mask next-step text was tested headless only;
    • no real-data run of the follow-ups (only simulated trees);
    • Windows and macOS were not run (GitHub Actions is blocked).

Tests

  • python tools/check.py in the cloud (Linux, Python 3.13, extras dev,notebook,zarr,he-mask): Ruff check and format clean, code rules clean, 9340 passed, 24 skipped (40 min).
  • Skip reasons:
    • case-insensitive file-system tests (3);
    • an editable install, so the code identity is never verified (3);
    • the release-only notebook pin (1);
    • fiberfeatures gate P3 (1);
    • root / POSIX-permission tests (2);
    • two by design (2);
    • the rest of the 24 are of the same kinds.
  • New tests: tests/test_cli_usability.py (--id, --ignore, open-question lines), tests/test_cli_tissue_mask.py (masks folder created and recorded, a non-empty folder refused, the image named once, the next-step commands), tests/test_ignored_masks.py (the strict reader and the manifest entry), and tests/test_cli_exit_status.py (both routes named).

Remaining for the owner's local gate

  1. python tools/check.py on the owner's machine. --release belongs to the release PR, which moves the notebook pins.
  2. Real-data checks again: ECM; formin OME-Zarr tiles (try declare-masks --ignore on their label images if any are unused); Zenodo H&E cores (the command-line H&E route in user guide §5: describe --id/--rgb-header-override, run, tissue-mask without a masks folder, declare-masks, run, masks, then fiberfeatures with region_mask).
  3. Review the session choices listed under Decisions and the plan Q94 wording.
  4. Approve the merge and the tag (never done by this session).

Generated by Claude Code

claude and others added 21 commits December 3, 2026 16:11
… write

Conda installs setuptools as an .egg-info without RECORD, and brick_identity's
closure (every extra included) reached it, so every entry record written in a
conda environment was uncertain and every rerun refused with
ENTRY_IDENTITY_UNCERTAIN (setuptools: RECORD missing).

- entry_identity: the installers pip, setuptools and wheel are neither listed
  nor followed in the requirement closure (INSTALL_TOOLS); every other library
  without RECORD stays uncertain (ADR 0007 (b)); a caller's explicit name is
  still identified. uncertain_library names the library behind an uncertain
  brick part.
- entry_record: write_entry_record warns (EntryIdentityWarning, text from
  identity_warning) that an output written under an uncertain identity will
  never be reused.
- entry_errors: uncertain_code_fix; the ENTRY_IDENTITY_UNCERTAIN fix names an
  uncertain library and why instead of telling the user to reinstall a brick
  that is already a released install.
- Tests with egg-info distributions in a temporary site folder; docs (contract
  21.2/21.4, plan 12 question 93), CHANGELOG Unreleased (v0.10.1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp98tSnytZ9QCrHt6297
- describe: fast mode no longer crashes on images fewer than three folder
  levels deep (condition/img.tif, an image in the experiment folder); the
  tagged unit comes from the discovered leaf folder.
- describe --rgb-header-override [FOLDER]: records rgb_header_override = true
  as the notebook does; the refusal of minisblack RGB TIFFs names it.
- check reports an undeclared mask type (OME-Zarr labels included) as run
  refuses it; declare-masks prints next commands without a placeholder
  masks folder when none was given.
- describe lists open questions only while the fast-mode options leave some.
- check and run suggest rgb when the published description declares every
  acquisition rgb (OME-Zarr states no colour interpretation).
- convert --store ome-zarr.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp983bS22og2asjnEc8P
…he plane

he_tissue_v1 fixes the white at 255. On the Zenodo 4550300 TMA cores the
glass is near (127, 135, 145), so every pixel read as stained (H >= 0.05
everywhere, no background) and tissue-mask kept 0.0 % of every core.

he_tissue_v2 estimates each channel's white as the median of the
brightest 0.1 % of pixels (by R+G+B), rescales with normalization's
rescale_to_white and applies v1's components unchanged. It is the new
default of RunInputs.he_tissue_mask, preview_he_tissue_mask,
he_tissue_mask_array, tissue-mask and the notebook card; v1 is unchanged
and still offered. Cores 1B_D9 and 2B_A6: 0.0 % -> 46.8 % and 44.4 % kept;
white-glass slides are unchanged within 0.4 points; blank slides keep
nothing.

Regression fixture: a 320 x 320 crop of core 1B_D9 (CC-BY-4.0) with its
generator script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AEzaRH4WH1TyJRA61
…able fix

- write_entry_record warned before the exclusive open, so a record that was
  not written (one already there) still said the output was written; the
  warning now follows the write.
- The fix for an editable library said pip install "<name>==<version>",
  which pip skips as already satisfied; it now forces the reinstall
  (--force-reinstall --no-deps), as the RECORD-missing fix does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp98tSnytZ9QCrHt6297
- The shared run/check texts no longer name a describe option; describe adds its own
  command-line line, and the override hint appears only for images it can lift
  (PhysicalIssue.override_fits).
- check's discovery_report.json records R_MASK_TYPE_NOT_DECLARED; the mask fix is
  shell-quoted.
- --rgb-header-override: without --channels says what is missing; the bare form mixed
  with folders is refused.
- --accept-ids leaves ID questions without a proposal open; counts use plural().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp983bS22og2asjnEc8P
v2's rescaling moves to he_tissue_rule.white_rescaled, and the lineage's
run facts (the RGB header override item, the recorded pixel size) move
to the new module he_tissue_run_facts (orchestration layer). No
behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AEzaRH4WH1TyJRA61
…o integration/v0.10.1

# Conflicts:
#	CHANGELOG.md
#	docs/plan.md
…into integration/v0.10.1

# Conflicts:
#	CHANGELOG.md
A folder whose name cannot be an ID (control, files) was a dead end on the
command line. --id FOLDER=ID (repeatable) names it, checked with the
notebook's own rules (Draft.confirm_id); a refusal names the option to give
again. The open-question line offers only the options that can answer what is
left, never --accept-ids for an ID with no proposal. The question texts move
to describe_questions.py (cli_describe stays under 600 lines).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9ASFzYU5CY2vs1ReWg
A run of scanner images often has no masks folder, and tissue-mask stopped
there. It now creates <experiment>_masks beside the experiment (or the empty
folder --masks names), records it by running preprocessing again with that
masks folder (as run --masks does; unchanged images are not read), and says so
in one line. A non-empty existing folder is never adopted.

Messages: a refusal names the image once; the next steps give the
declare-masks, run and masks commands (no source_channels, which declare-masks
cannot set), and the region as a brick's settings name it (region_mask), not
MaskRequest(<ID>, 'region').

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9ASFzYU5CY2vs1ReWg
The fix pointed only to the notebook although describe --publish publishes from
the command line. It now names the notebook's describe steps and the describe
command with its fast-mode options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9ASFzYU5CY2vs1ReWg
…wner's 4 December follow-ups

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9ASFzYU5CY2vs1ReWg
… they do not use

An OME-Zarr label image of another tool, or a mask type outside the analysis,
was refused as undeclared with no way out but declaring or deleting it.
declare-masks --ignore TYPE (repeatable) lists it in ignored_masks.toml beside
morphobricks.toml (the description schema has no such field; owner choice of a
TOML file in the output folder). check and run leave those types out of mask
discovery; the run records the list and the file's SHA-256 in the manifest
(optional key ignored_masks), so RunInputs.open neither counts them as
unrecorded nor accepts a list changed since the run (RUN_FOLDER_STALE).
Undeclared types not listed are still refused, and the refusal's fix now names
--ignore beside --type. A declared type cannot be ignored; declaring a type
takes it off the list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9ASFzYU5CY2vs1ReWg
…re, the H&E route

User guide §5 (describe --id, declare-masks --ignore, tissue-mask and the whole
H&E route on the command line), §6 (ignored_masks.toml), §8
(ignored_masks_invalid); contract §9 (the manifest's ignored_masks key); plan
§12 question 94 (the owner's decision on where the ignore list lives);
CHANGELOG Unreleased (v0.10.1); AGENTS.md repository map.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9ASFzYU5CY2vs1ReWg
The owner's run of the formin OME-Zarr mosaic (30720 x 36864 x 3, uint16,
chunks 1 x 1024 x 1024; 4 December 2026) found two points:

- run warned "would need up to 38.0 GiB" while xyc_plane_memory gave
  14.8 GiB for the same plane. Both are right: the run's figure is one
  channel read and measured (33.8 GiB of it the histogram's working
  arrays), read_plane's the pixels of all three channels with no
  histogram. planes_read_in_blocks, the notebook's run plan and
  read_plane's PlaneMemoryError now say which is which. Tested on a
  lazily written store of the mosaic's size (zarr_tree.Unwritten).
- link_outside_folder stays (owner decision of 2 November 2026, #81,
  plan Q64); its message now says the images behind the links are not
  found and why, and the fix says to move the data in. An opt-in that
  follows links is plan Q95, proposed, not decided.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp996hygHEfLZ4jtxi1A
…emory

v0.10.1: name the two plane memory figures apart; say why links out of the experiment are refused
…or windows

convert --store ome-zarr (and the notebook's copy) wrote each plane as one
chunk, so a windowed reader decoded the whole plane for every window and
refused the first patch of a large slide after check had passed.

- ome_zarr_copy: chunks 1 x ... x min(Y,1024) x min(X,1024), written block by
  block in place (edge chunks full size, zero-filled); no pyramid.
- windows: smallest_window_memory, chunk_note (fix advice on refusals).
- window_reader: WindowReader refuses at open an OME-Zarr whose chunks leave no
  window within the limit with its cache.
- window_chunks (new): check_window_chunks -> warning
  chunks_too_large_for_windows, from check and run.
- tests/test_ome_zarr_chunks.py; CHANGELOG, contract, user guide, AGENTS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…unks

OME-Zarr copies in 1024 x 1024 chunks; warn about stores too coarse for windows
… README

Every subcommand gets a description and examples; success lines say what
was saved and print the next commands with the user's options (quoted);
refusals say what, why and what to do. Codes, severities and paths are
unchanged. README and user guide follow the complete workflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp99saj5j4QZfMeAZQUm
@guijacquemet

Copy link
Copy Markdown
Contributor Author

Handoff plan: MorphoBricks v0.10.1 mini wave and fiberfeatures v0.9.1 (4 December 2026)

Goals: (1) a functional MorphoBricks pipeline installable from tags; (2) fiberfeatures runnable on its own with the two-step entry (preprocessing run, then fiberfeatures settings -o → edit → check → run), shareable with collaborators.

Full history: wave_v0.10.0_night_log.md (same folder). Rule: no merge into any main and no tag without the owner's OK.

Where the work is (all pushed to GitHub)

Repo Branch / PR State
morphobricks-preprocessing integration/v0.10.1, PR #623 → main ready; gate cand0202 clean (9356 passed)
fiberfeatures docs/user-guide-v0.9.1, PR #257 → integration/v0.9.1 #255 #256 #258 #259 #261 #262 #265 #260 #264 #263 merged in (head f8920ab or later); full suite to confirm after the last merges
fiberfeatures fix/chatgpt-code-review (cloud session ff-chatgpt-code) waits for the owner's ChatGPT code-review reply
fiberfeatures docs/chatgpt-review (cloud session ff-chatgpt-docs) first docs review applied (#263); takes further replies
MorphoObjects PR #93 → main 0.8.1: identity test fixed; re-pin to tags at release
MorphoFeature PR #320 → main diagnostics one file per provider (schema 5→6): later release, not 0.8.1
MorphoBricks-Spec #90 (ADR 0007 amendment) merge with preprocessing v0.10.1
MorphoBricks-Spec #91 (ADR 0014 inspection outputs) stays proposed; answer its open questions later

Remaining steps, in order

  1. ChatGPT code review reply → ff-chatgpt-code applies it on fix/chatgpt-code-review → merge into docs/user-guide-v0.9.1.
  2. fiberfeatures docs reorganisation (before v0.9.1): check concepts.md and theory.md against the code (keep if accurate); fold batch_processing.md into docs/python.md (keep anchors code cites); delete docs/developer/review_prompts.md (keep a copy outside the repo); notebooks README: "use the docs for now" (notebooks updated after v0.9.1).
  3. fiberfeatures requires morphobricks-preprocessing[zarr] (replace the separate pip install zarr line); check pip accepts it beside other bricks' plain pins.
  4. Local gate on preprocessing integration/v0.10.1 + fiberfeatures docs/user-guide-v0.9.1 + MorphoObjects [Sad Catapella B6][Numeric correctness] Micrometre conversion overflow can classify radically different pixel sizes as equal #93 + others at tags (gate.py multi … --tests --e2e). Expected only: MorphoFeature notebook-pin tests at tag v0.8.0; MorphoObjects test_pins_equal_cellpatchers_own (fixed by the mini wave); he_tissue mask hashes (v2 rule).
  5. Mini wave (owner OK at each step):
    1. preprocessing v0.10.1: release commits A/B (notebook RELEASE_REF scheme), merge v0.10.1: entry identity in conda, CLI gaps, H&E tissue v2, owner follow-ups #623, tag; merge Spec [Sad Catapella B5][Scientific integrity] Source files may change between fingerprint capture and histogram publication #90.
    2. CellPatcher v0.10.1: pins only (preprocessing v0.10.1, core and [zarr]), short gate, merge, tag.
    3. MorphoObjects 0.8.1 ([Sad Catapella B6][Numeric correctness] Micrometre conversion overflow can classify radically different pixel sizes as equal #93), MorphoEmbed 0.8.1, MorphoRelate 0.8.1 (also its morphocoverage extra → v0.2.0), fiberfeatures 0.9.1 (integration/v0.9.1 ← docs/user-guide-v0.9.1, → main): re-pin to tags, one gate, merge, tag each.
    4. MorphoFeature 0.8.1: pins + notebook tested set (A/B scheme), short gate, merge, tag.
  6. Clean env from tags (morphobricks-release-style), smoke + Formin e2e + the four-input fiberfeatures checks; then share fiberfeatures v0.9.1 (README install + docs/start_here.md).

Decided, deferred

Example TIFFs stay in git; CITATION.cff later with a DOI; repository stays private (token wording stays); notebooks updated after v0.9.1; MorphoFeature #320 in its next release; preprocessing --follow-links not built (symlinks refused by design); output-file audit: MorphoFeature diagnostics (#320), coverage-copy removal next minor; 3-D (#617) after this wave (ADR 0010 accepted; MorphoFeature P-2 guard next).

Notes for whoever resumes

  • Gate: ~/software/morphobricks_gate/gate.py (env morphobricks-gate, installs --no-deps from local clones; suites run single-core; this machine ran ~60 % slower on 4 December than on 3 December — compare timings within a day only).
  • Agents must never pip install into morphobricks-gate; fiberfeatures' 8 E3 byte baselines fail only in cloud containers (torch drift).
  • Candidate env morphobricks-candidate and release env morphobricks-release exist for real-data checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp99saj5j4QZfMeAZQUm
… a masks folder

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp99saj5j4QZfMeAZQUm
Conflicts with #627's wording resolved: cli.py and cli_describe.py keep
both sides' new functions; tissue-mask checks its prerequisites before
creating the masks folder and keeps #627's created flag; the
comparability refusal keeps #627's sentence and #628's pointer to the
Check and save card; the user guide keeps #627's text and says check
reuses the earlier run's exclusions and masks folder.

Follow-ups of the merge: describe_command's ignored-option refusals moved
to _ignored_options (C901); check_ignore wraps an unreadable ignore list
with unreadable_fix, as ignore_masks does, so the early refusal keeps the
recovery text; the header-rewrite test expects #627's message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- describe_ids.REASONS and description_run_text._MEANINGS keyed by the
  Code / Refusal constants of description_rules, not code strings, and
  _meaning reads a code's family instead of matching code prefixes: the
  Spec's "no second copy of the rules" scan (test_spec_no_fallback)
  allows code tables only in description_rules.py.
- test_description_write_types and test_calibrate_containment expect the
  new wording ("of type numpy.bool, E_TYPE)", "Calibration saved to").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#628 imported he_tissue_mask at the top of cli_tissue_mask, so a
core-only install loaded morphobricks_normalization.stain and the H&E
code on any CLI start (test_he_tissue_core_only failed). The import
moves into _prerequisites.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants